
<%= form_tag copy_question_list_path(@question_list), id: 'form_qvcopy', method: 'post', remote: true do %>
  <%= hidden_field_tag 'from', @question_list_from.nil? ? '' : @question_list_from.id %>
  <%= really_submit_tag %>
  <p>请选择从哪个列表复制</p>
  <ul>
    <% QuestionList.all.each do |question_list| %>
      <li><%= js_tag question_list.name, {
        "set('from','#{question_list.id}')" => 'form_qvcopy',
        submit: 'form_qvcopy'
      } %></li>
    <% end %>
  </ul>
  <hr/>
  <% if !@question_list_from.nil? %>
    <table class="qvcopy">
    <% @question_list_from.questions.sort.each do |question| %>
      <tr>
        <td class="checkbox"><%= check_box_tag 'questions[]', question.id %></td>
        <td><%= render question.current_version %></td>
      </tr>
    <% end %>
    </table>
  <% end %>
  <%= submit_tag '提交', onclick: create_js_true({
    "set('really_submit','true')" => 'form_qvcopy'
  }) %>
  <%= button_tag '取消', type: 'button', onclick: 
    "$(window.location).attr('href', '#{question_list_url(@question_list.id)}');" %>
<% end %>